package com.genesis.web.controller;


import com.genesis.mall.common.PageInfo;
import com.genesis.mall.common.Result;
import com.genesis.mall.service.ISmsCouponHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 优惠券使用、领取历史表 前端控制器
 * </p>
 *
 * @author author
 * @since 2022-08-01
 */
@RestController
@RequestMapping("/couponHistory")
public class SmsCouponHistoryController {

    @Autowired
    private ISmsCouponHistoryService couponHistoryService;

    @GetMapping("/list")
    private Result historyRecord(@RequestParam(required = false) Integer couponId,
                                 @RequestParam(required = false) String orderSn,
                                 @RequestParam(required = false) Integer pageNum,
                                 @RequestParam(required = false) Integer pageSize,
                                 @RequestParam(required = false) Integer useStatus) {

        PageInfo pageInfo = couponHistoryService.historyRecord(couponId, orderSn, pageNum, pageSize, useStatus);

        return Result.success(pageInfo);
    }
}